﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace TinyCinema.UI.Pages.Cinema
{
    /// <summary>
    /// Interaction logic for Cinemas.xaml
    /// </summary>
    public partial class MainPage : TabPage
    {
        public MainPage()
        {
            InitializeComponent();
            TabControls = (FindResource("TabList") as ItemsControl).Items;
        }
        public Room pagRoom = new Room();
        public Desk pagDesk = new Desk();
        protected override void TabControl(object sender, RoutedEventArgs e)
        {
            if ((sender as Button).Visibility == System.Windows.Visibility.Collapsed) return;
            if (!IsIniting && (e == null || e.OriginalSource == null)) return;
            base.TabControl(sender, e);

            switch ((sender as Button).Uid)
            {
                case "Room": pagContentFrameSource = pagRoom;
                    break;
                case "Desk": pagContentFrameSource = pagDesk;
                    break;
            }
        }
    }
}
